<template>
  <div class="app-container">
    <component :is="detailComponent" :form="formData"></component>
  </div>
</template>

<script>

export default {
  name: "dynamicComponent",
  props:{
    // 数量限制
    uri: {
      type: String,
      default: '/test/testHoliday/testHolidayForm',
    },
    formData: {
      type: Object,
      required: false,
      default: () => {
        return {}
      }
    }
  },
  computed: {
    detailComponent(){
      if(this.uri){
        return resolve => require.ensure([], () => resolve(require('@/views'+this.uri+'.vue')))
      }else{
        return null
      }
    }
  },
  data() {
    return {

    };
  },
  created() {

  },
  methods: {

  }
};
</script>
